package com.youkang.youkangseleniumjava.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.text.SimpleDateFormat;
import java.util.Date;

/**
 * @author 邓昕劼
 * @version 1.3
 */
@RestController
@RequestMapping("/opening")
public class Opening {

    @Autowired
    private SeleniumController selenium;


    @RequestMapping("/selenium1")
    public void selenium1(){
        selenium.Selenium();
    }

    public static void main(String[] args) {
        String str = "整理床单位 (15.0分钟)\n生活自理能力训练 (30.0分钟)\n协助排泄 (15.0分钟)";
        String[] tasks = str.split("\n");

        StringBuilder result = new StringBuilder();
        for (String task : tasks) {
            String name = task.replaceAll(" \\(.*\\)", ""); // 移除括号和里面的内容
            result.append(name).append(",");
        }
        String finalResult = result.toString();
        finalResult = finalResult.length() > 0 ? finalResult.substring(0, finalResult.length() - 1) : finalResult; // 移除最后一个逗号
        System.out.println(finalResult);
    }



}
